<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title></title>

    <meta name="keywords" content="{$Think.CONFIG.keywords}"/>
    <meta name="description" content="{$Think.CONFIG.description}"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    {include file="public/head" /}

</head>
<body>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>

        {include file="public/nav"/}

        {include file="public/menu"/}

        <div class="main-content">
            {include file="public/breadcrumb"/}

            <div class="page-content">
                <div class="row">
                    <div class="cf">
                        <a class="btn btn-info" href="{:url('branch/add')}">新增</a>
                    </div>
                    <div class="space-4"></div>
                    <table class="table table-bordered table-striped">
                        <tr>
                            <td align="center">门店编号</td>
                            <td align="center">门店地址</td>
                            <td align="center">电话号码</td>
                            <td align="center">操作</td>
                        </tr>
                        {volist name='list' id='b'}
                        <tr>
                            <td align="center">{$b.num}</td>
                            <td align="center">{$b.address}</td>
                            <td align="center">{$b.phone}</td>
                            <td align="center">
                                <a href="{:url('branch/add')}/id/{$b.id}" style="cursor:pointer;">修改</a>&nbsp;&nbsp;
                                <a href="javascript:del({$b.id});" style="cursor:pointer;">删除</a>
                            </td>
                        </tr>
                        {/volist}
                    </table>

                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div><!-- /.main-content -->

    </div><!-- /.main-container-inner -->

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="fa fa-angle-double-up fa-only bigger-110"></i>
    </a>
</div>
</body>
{include file="public/footerjs"/}
<script src="__ADMIN__/ace/js/bootbox.min.js"></script>

<script>
    (function () {
        del = function (id) {
            bootbox.confirm("确定要删除该条数据？", function (result) {
                if (result)
                    $.post("{:url('del')}", {id: id}, function (data) {
                        if (data > 0) {
                            bootbox.alert("删除成功");
                            setTimeout(function () {
                                location.reload();
                            }, 1000)
                        } else {
                            bootbox.alert("删除失败");
                        }
                    })

            });
        }
    }());
</script>

{include file="public/foot" /}
